package com.naiterui.ehp.bs.b2c.cart.service;

import java.util.List;

import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.b2c.cart.vo.CartVO;
import com.naiterui.ehp.bs.b2c.cart.vo.SettlementVO;
import com.naiterui.ehp.bs.b2c.common.bo.cart.CartItemBO;

/**
 * @author guoyongxiang
 * @date 2019-05-15 13:27
 * @since 1.0.0
 */
public interface ICartService {

    /**
     * 获取购物车列表
     *
     * @param userId
     * @return
     */
    CartVO getInfo(Long userId) throws BusinessException;

    /**
     * 加入购物车
     *
     * @param userId
     * @param recomId
     * @param skuId
     * @param quantity
     * @return
     */
    boolean add(Long userId, Long recomId, Long skuId, Integer quantity) throws BusinessException;

    /**
     * 更新勾选状态
     *
     * @param userId
     * @param all
     * @param recomId
     * @param itemId
     * @param selected
     * @return
     */
    boolean updateSelected(Long userId, Integer all, Long recomId, Long itemId, Integer selected) throws BusinessException;

    /**
     * 更新购物车商品数量
     *
     * @param userId
     * @param itemId
     * @param quantity
     * @return
     */
    boolean updateQuantity(Long userId, Long itemId, Integer quantity) throws BusinessException;

    /**
     * 删除购物车商品
     *
     * @param userId
     * @param recomId
     * @param itemId
     * @return
     */
    boolean delete(Long userId, Long recomId, Long itemId) throws BusinessException;

    /**
     * 获取结算中心
     *
     * @param userId
     * @param shippingInfoId
     * @return
     */
    SettlementVO settlements(Long userId, Long shippingInfoId) throws BusinessException;

    /**
     * 获取用户购物车有效商品(缺货、下架、处方失效 throw异常)
     *
     * @param userId
     * @return
     */
    List<CartItemBO> getCartItems(Long userId) throws BusinessException;

    /**
     * 清空购物车
     *
     * @param userId
     * @param items
     * @return
     * @throws BusinessException
     */
    void clearCart(Long userId, List<Long> items) throws BusinessException;

    /**
     * 获取患者实名状态
     *
     * @param patientId
     * @return
     * @throws BusinessException
     */
    Integer getPatientRealNameStatus(Long patientId) throws BusinessException;

    /**
     * 请求购物车失效且已再次求药的处方记录
     *
     * @param recomId
     * @throws BusinessException
     */
    public void removeExpireRequireRecom(Long recomId) throws BusinessException;

    /**
     * 处方直接结算
     *
     * @param userId
     * @param recomId
     * @param shippingInfoId
     * @return
     * @throws BusinessException
     */
    SettlementVO recomSettlement(Long userId, Long recomId, Long shippingInfoId) throws BusinessException;
}
